package com.jerry.controller;

/**
 * Created by Shirly on 2016/9/21.
 */
public class TestEnum {
    private enum Name {Tom, Jerry, Apple, Banana} ;


    private Name name;

    public void print(Name name) {
        switch (name) {
            case Tom:
                System.out.println("Tom");
                break;
            case Jerry:
                System.out.println("Jerry");
                break;
            case Apple:
                System.out.println("Apple");
                break;
            case Banana:
                System.out.println("Banana");
                break;
        }
    }

    public TestEnum() {
        name = Name.Banana;
        print(name);
    }

    public static void main(String args[]) {
        TestEnum te = new TestEnum();
    }
}

